home *** CD-ROM | disk | FTP | other *** search
/ World of Video / World of Video.iso / gfxprograms / 3dprograms / t3dlib / source / tddd_new.doc < prev    next >
Text File  |  1995-02-13  |  29KB  |  683 lines

  1.  
  2.                       FORM TDDD
  3.                       ---------
  4.  
  5.     FORM TDDD is used by Impulse's Turbo Silver 3.0 for 3D rendering
  6.     data.  TDDD stands for "3D data description".  The files contain
  7.     object and (optionally) observer data.
  8.  
  9.     Turbo Silver's successor, "Imagine", uses an upgraded FORM TDDD
  10.     when it reads/writes object data.
  11.  
  12.     Currently, in "standard IFF" terms, a FORM TDDD has only two chunk
  13.     types:  an INFO chunk describing observer data;  and an OBJ chunk
  14.     describing an object heirarchy.  The INFO chunk appears only in
  15.     Turbo Silver's "cell" files, and the OBJ chunk appears in both
  16.     "cell" files and "object" files.
  17.  
  18.     The FORM has an (optional) INFO chunk followed by some number of
  19.     OBJ chunks.  (Note:  OBJ is followed by a space -- ckID = "OBJ ")
  20.  
  21.     The INFO and OBJ chunks, in turn, are made up of smaller chunks with
  22.     the standard IFF structure:  <ID> <data-size> <data>.
  23.  
  24.     The INFO "sub-chunks" are relatively straightforward to interpret.
  25.  
  26.     The OBJ "sub-chunks" support object heirarchies, and are slightly
  27.     more difficult to interpret.  Currently, there are 3 types of OBJ
  28.     sub-chunks:  an EXTR chunk, describing an "external" object in a
  29.     seperate file; a DESC chunk, describing one node of a heirarchy;
  30.     and a TOBJ chunk marking the end of a heirarchy chain.  For each
  31.     DESC chunk, there must be a corresponding TOBJ chunk.  And an
  32.     EXTR chunk is equivalent to a DESC/TOBJ pair.
  33.  
  34.     In Turbo Silver and Imagine, the structure of the object heirarchy
  35.     is as follows.  There is a head object, and its (sexist) brothers.
  36.     Each brother may have child objects.  The children may have
  37.     grandchildren, and so on. The brother nodes are kept in a doubly
  38.     linked list, and each node has a (possibly NULL) pointer to a
  39.     doubly linked "child" list. The children point to the "grandchildren"
  40.     lists, and so on.  (In addition, each node has a "back" pointer to
  41.     its parent).
  42.  
  43.     Each of the "head" brothers is written in a seperate OBJ chunk,
  44.     along with all its descendants.  The descendant heirarchy is
  45.     supported as follows:
  46.  
  47.         for each node of a doubly linked list,
  48.  
  49.         1)  A DESC chunk is written, describing its object.
  50.         2)  If it has children, steps 1) to 3) are performed
  51.                 for each child.
  52.         3)  A TOBJ chunk is written, marking the end of the children.
  53.  
  54.     For "external" objects, steps 1) to 3) are not performed, but
  55.     an EXTR chunk is written instead.  (This means that an external
  56.     object cannot have children unless they are stored in the same
  57.     "external" file).
  58.  
  59.     The TOBJ sub-chunks have zero size -- and no data.  The DESC
  60.     and EXTR sub-chunks are made up of "sub-sub-chunks", again,
  61.     with the standard IFF structure:  <ID> <data-size> <data>.
  62.  
  63.     ( "External" objects were used by Turbo Silver to allow a its
  64.     "cell" data files to refer to an "object" data file that is
  65.     "external" to the cell file.  Imagine abandons the idea of
  66.     individual cell files, and deals only in TDDD "object" files.
  67.     Currently, Imagine does not support EXTR chunks in TDD files.)
  68.  
  69.     Reader software WILL FOLLOW the standard IFF procedure of
  70.     skipping over any un-recognized chunks -- and "sub-chunks"
  71.     or "sub-sub-chunks". The <data-size> field indicates how many
  72.     bytes to skip.  In addition it WILL OBSERVE the IFF rule that
  73.     an odd <data-size> may appear, in which case the corredponding
  74.     <data> field will be padded at the end with one extra byte to
  75.     give it an even size.
  76.  
  77.  
  78.     Now, on with the details.
  79.  
  80.     First, there are several numerical fields appearing in the data,
  81.     describing object positions, rotation angles, scaling factors, etc.
  82.     They are stored as "32-bit fractional" numbers, such that the true
  83.     number is the 32-bit number divided by 65536.  So as an example,
  84.     the number 3.14159 is stored as (hexadecimal) $0003243F.  This
  85.     allows the data to be independant of any particular floating point
  86.     format. And it (actually) is the internal format used in the
  87.     "integer" version of Turbo Silver.  Numbers stored in this format
  88.     are called as "FRACT"s below.
  89.  
  90.     Second, there are several color (or RGB) fields in the data.
  91.     They are always stored as three UBYTEs representing the red,
  92.     green and blue components of the color.  Red is always first,
  93.     followed by green, and then blue.  For some of the data chunks,
  94.     Turbo Silver reads the color field into the 24 LSB's of a
  95.     LONGword.  In such cases, the 3 RGB bytes are preceded by a
  96.     zero byte in the file.
  97.  
  98.  
  99.     The following "typedef"s are used below:
  100.  
  101.     typedef LONG    FRACT;                /* 4 bytes */
  102.     typedef UBYTE   COLOR[3];             /* 3 bytes */
  103.  
  104.     typedef struct vectors {
  105.         FRACT X;          /* 4 bytes */
  106.         FRACT Y;          /* 4 bytes */
  107.         FRACT Z;          /* 4 bytes */
  108.     } VECTOR;             /* 12 bytes total */
  109.  
  110.     typedef struct matrices {
  111.         VECTOR I;         /* 12 bytes */
  112.         VECTOR J;         /* 12 bytes */
  113.         VECTOR K;         /* 12 bytes */
  114.     } MATRIX;             /* 36 bytes total */
  115.  
  116.     typedef struct _tform {
  117.         VECTOR r;         /* 12 bytes - position */
  118.         VECTOR a;         /* 12 bytes - x axis */
  119.         VECTOR b;         /* 12 bytes - y axis */
  120.         VECTOR c;         /* 12 bytes - z axis */
  121.         VECTOR s;         /* 12 bytes - size */
  122.     } TFORM;              /*  60 bytes total */
  123.  
  124.     The following structure is used in generating animated cells
  125.     from a single cell.  It can be attached to an object or to the
  126.     camera.  It is also used for Turbo Silver's "extrude along a
  127.     path" feature.  (It is ignored & forgotten by Imagine)
  128.  
  129.     typedef struct story {
  130.         UBYTE  Path[18];  /* 18 bytes */
  131.         VECTOR Translate; /* 12 bytes */
  132.         VECTOR Rotate;    /* 12 bytes */
  133.         VECTOR Scale;     /* 12 bytes */
  134.         UWORD  info;      /*  2 bytes */
  135.     } STORY;              /* 56 bytes total */
  136.  
  137.     The Path[] name refers to a named object in the cell data.
  138.     The path object should be a sequence of points connected
  139.     with edges.  The object moves from the first point of the
  140.     first edge, to the last point of the last edge.  The edge
  141.     ordering is important.  The path is interpolated so that
  142.     the object always moves an equal distance in each frame of
  143.     the animation.  If there is no path the Path[] field should
  144.     be set to zeros.
  145.     The Translate vector is not currently used.
  146.     The Rotate "vector" specifies rotation angles about the
  147.     X, Y, and Z axes.
  148.     The Scale vector specfies X,Y, and Z scale factors.
  149.     The "info" word is a bunch of bit flags:
  150.  
  151.         ABS_TRA    0x0001    - translate in world coorinates (not used)
  152.         ABS_ROT    0x0002    - rotation in world coorinates
  153.         ABS_SCL    0x0004    - scaling in world coorinates
  154.         LOC_TRA    0x0010    - translate in local coorinates (not used)
  155.         LOC_ROT    0x0020    - rotation in local coorinates
  156.         LOC_SCL    0x0040    - scaling in local coorinates
  157.         X_ALIGN    0x0100    - (not used)
  158.         Y_ALIGN    0x0200    - align Y axis to path's direction
  159.         Z_ALIGN    0x0400    - (not used)
  160.         FOLLOW_ME  0x1000    - children follow parent on path
  161.  
  162.     DESC sub-sub-chunks
  163.     -------------------
  164.  
  165.     NAME - size 18
  166.  
  167.         BYTE    Name[18];       ; a name for the object.
  168.  
  169.         Used for camera tracking, specifying story paths, etc.
  170.  
  171.     SHAP - size 4
  172.  
  173.         WORD    Shape;          ; number indicating object type
  174.         WORD    Lamp;           ; number indicating lamp type
  175.  
  176.         Lamp numbers are composed of several bit fields:
  177.  
  178.         Bits 0-1:
  179.             0 - not a lamp
  180.             1 - like sunlight
  181.             2 - like a lamp - intensity falls off with distance.
  182.             3 - unused/reserved
  183.  
  184.         Bits 2:
  185.             0 - non-shadow-casting light
  186.             4 - shadow-casting light
  187.  
  188.         Bits 3-4:
  189.             0  - Spherical light source
  190.             8  - Cylindrical light source.
  191.             16 - Conical light source.
  192.             24 - unused/reserved
  193.  
  194.         Shape numbers are:
  195.  
  196.             0 - Sphere
  197.             1 - Stencil         ; not supported by Imagine
  198.             2 - Axis            ; custom objects with points/triangles
  199.             3 - Facets          ; illegal - for internal use only
  200.             4 - Surface         ; not supported by Imagine
  201.             5 - Ground
  202.  
  203.         Spheres have thier radius set by the X size parameter.
  204.         Stencils and surfaces are plane-parallelograms, with one
  205.         point at the object's position vector; one side lying along
  206.         the object's X axis with a length set by the X size; and
  207.         another side starting from the position vector and going
  208.         "Y size" units in the Y direction and "Z size" units in
  209.         the X direction.  A ground object is an infinte plane
  210.         perpendicular to the world Z axis.  Its Z coordinate sets
  211.         its height, and the X and Y coordinates are only relevant
  212.         to the position of the "hot point" used in selecting the
  213.         object in the editor.  Custom objects have points, edges
  214.         and triangles associated with them.  The size fields are
  215.         relevant only for drawing the object axes in the editor.
  216.         Shape number 3 is used internally for triangles of custom
  217.         objects, and should never appear in a data file.
  218.  
  219.     POSI - size 12
  220.  
  221.         VECTOR  Position;       ; the object's position.
  222.  
  223.         Legal coordinates are in the range -32768 to 32767 and 65535/65536.
  224.         Currently, the ray-tracer only sees objects in the -1024 to 1024
  225.         range.  Light sources, and the camera may be placed outside that
  226.         range, however.
  227.  
  228.     AXIS - size 36
  229.  
  230.         VECTOR  XAxis;
  231.         VECTOR  YAxis;
  232.         VECTOR  ZAxis;
  233.  
  234.         These are direction vectors for the object coordinate system.
  235.         They must be "orthogonal unit vectors" - i.e. the sum of the
  236.         squares of the vevtor components must equal one (or close to it),
  237.         and the vectors must be perpendicular.
  238.  
  239.     SIZE - size 12
  240.  
  241.         VECTOR  Size;
  242.  
  243.         See SHAP chunk above.  The sizes are used in a variety of ways
  244.         depending on the object shape.  For custom objects, they are
  245.         the lengths of the coordinate axes drawn in the editor.  If the
  246.         object has its "Quickdraw" flag set, the axes lengths are also
  247.         used to set the size of a rectangular solid that is drawn rather
  248.         than drawing all the points and edges.
  249.  
  250.     PNTS - size 2 + 12 * point count
  251.  
  252.         UWORD   PCount;         ; point count
  253.         VECTOR  Points[];       ; points
  254.  
  255.         This chunk has all the points for custom objects.  The are
  256.         refered to by thier position in the array.
  257.  
  258.     EDGE - size 4 + 4 * edge cout
  259.  
  260.         UWORD   ECount;         ; edge count
  261.         UWORD   Edges[][2];     ; edges
  262.  
  263.         This chunk contins the edge list for custom objects.
  264.         The Edges[][2] array is pairs of point numbers that
  265.         are connected by the edges.  Edges are refered to by thier
  266.         position in the Edges[] array.
  267.  
  268.     FACE - size 2 + 6 * face count
  269.  
  270.         UWORD   TCount;         ; face count
  271.         UWORD   Connects[][3];  ; faces
  272.  
  273.         This chunk contains the triangle (face) list for custom objects.
  274.         The Connects[][3] array is triples of edge numbers that are
  275.         connected by triangles.
  276.  
  277.     PTHD - size 2 + 6 * axis count - Imagine only
  278.  
  279.         UWORD   ACount;         ; axis count
  280.         TFORM   PData[][3];     ; axis data
  281.  
  282.         This chunk contains the axis data for Imagine "path" objects.
  283.         The PData array contains a TFORM structure for each point along
  284.         the path.  The "Y size" item for the last point on the path tells
  285.         whether the path is closed or not.  Zero means closed, non-zero
  286.         means open.  Otherwise the Y size field is the distance along
  287.         the path to the next path point/axis.
  288.  
  289.     COLR - size 4
  290.     REFL - size 4
  291.     TRAN - size 4
  292.     SPC1 - size 4 - Imagine only
  293.  
  294.         BYTE    pad;            ; pad byte - must be zero
  295.         COLOR   col;            ; RGB color
  296.  
  297.         These are the main object RGB color, and reflection, transmission
  298.         and specularity coefficients.
  299.  
  300.     CLST - size 2 + 3 * count
  301.     RLST - size 2 + 3 * count
  302.     TLST - size 2 + 3 * count
  303.  
  304.         UWORD   count;          ; count of colors
  305.         COLOR   colors[];       ; colors
  306.  
  307.         These are the color, reflection and transmission coefficients
  308.         for each face in custom objects. The count should match the
  309.         face count in the FACE chunk. The ordering corresponds to the
  310.         face order.
  311.  
  312.     TPAR - size 64 - not written by Imagine - see TXT1 below
  313.  
  314.         FRACT   Params[16];     ; texture parameters
  315.  
  316.         This is the list of parameters for texture modules when
  317.         texture mapping is used.
  318.  
  319.     TXT1 - variable size - Imagine only
  320.  
  321.         This chunk contains texture data when texture mapping is used.
  322.  
  323.         UWORD   Flags;          ; texture flags:
  324.                                 ;    1 - TXTR_CHILDREN - apply to child objs
  325.         TFORM   TForm;          ; local coordinates of texture axes.
  326.         FRACT   Params[16];     ; texture parameters
  327.         UBYTE   PFlags[16];     ; parameter flags (currently unused)
  328.         UBYTE   Length;         ; length of texture file name
  329.         UBYTE   Name[Length];   ; texture file name (not NULL terminated)
  330.         UBYTE   pad;            ; (if necessary to make an even length)
  331.  
  332.     BRS1 - variable size - Imagine only (version 1.0)
  333.     BRS2 - variable size - Imagine only (version 1.1)
  334.  
  335.         UWORD   Flags;          ; brush type:
  336.                                 ;    0 - Color
  337.                                 ;    1 - Reflection
  338.                                 ;    2 - Filter
  339.                                 ;    3 - Altitude
  340.         UWORD   WFlags;         ; brush wrapping flags:
  341.                                 ;    1   WRAP_X        - wrap type
  342.                                 ;    2   WRAP_Z        - wrap type
  343.                                 ;    4   WRAP_CHILDREN - apply to children
  344.                                 ;    8   WRAP_REPEAT   - repeating brush
  345.                                 ;    16  WRAP_FLIP     - flip with repeats
  346.         TFORM   TForm;          ; local coordinates of brush axes.
  347.         (UWORD   FullScale;)    ; full scale value
  348.         (UWORD   MaxSeq;)       ; highest number for sequenced brushes
  349.         UBYTE   Length;         ; length of brush file name
  350.         UBYTE   Name[Length];   ; brush file name (not NULL terminated)
  351.         UBYTE   pad;            ; (if necessary to make an even length)
  352.  
  353.         The FullScale and MaxSeq items are in BRS2 chunks only.
  354.  
  355.     SURF - size 5 - not written by Imagine
  356.  
  357.         BYTE    SProps[5];      ; object properties
  358.  
  359.         This chunk contains object (surface) properties used
  360.         by Turbo Silver.
  361.  
  362.         SProps[0] - PRP_SURFACE ; surface type
  363.                                 ;   0 - normal
  364.                                 ;   4 - genlock
  365.                                 ;   5 - IFF brush
  366.         SProps[1] - PRP_BRUSH   ; brush number (if IFF mapped)
  367.         SProps[2] - PRP_WRAP    ; IFF brush wrapping type
  368.                                 ;   0 - no wrapping
  369.                                 ;   1 - wrap X
  370.                                 ;   2 - wrap Z
  371.                                 ;   3 - wrap X and Z
  372.         SProps[3] - PRP_STENCIL ; stencil number for stencil objects
  373.         SProps[4] - PRP_TEXTURE ; texture number if texture mapped
  374.  
  375.     MTTR - size 2 - not written by Imagine - see PRP1 chunk.
  376.  
  377.         UBYTE   Type;           ; refraction type (0-4)
  378.         UBYTE   Index;          ; custom index of refraction
  379.  
  380.         This chunk contains refraction data for transparent or
  381.         glossy objects.  If the refraction type is 4, the object
  382.         has a "custom" refractive index stored in the Index field.
  383.         The Index field is 100 * (true index of refraction - 1.00)
  384.         -- so it must be in the range of 1.00 to 3.55.  The
  385.         refraction types is 0-3 specify 0) Air - 1.00, 1) Water - 1.33,
  386.         2) Glass - 1.67 or 3) Crystal 2.00.
  387.  
  388.     SPEC - size 2 - not written by Imagine - see SPC1 above.
  389.  
  390.         UBYTE   Specularity;    ; range of 0-255
  391.         UBYTE   Hardness;       ; specular exponent (0-31)
  392.  
  393.         This chunk contains specular information.  The Specularity
  394.         field is the amount of specular reflection -- 0 is none,
  395.         255 is fully specular.  The "specular exponent" controls
  396.         the "tightness" of the specular spots.  A value of zero
  397.         gives broad specular spots and a value of 31 gives smaller
  398.         spots.
  399.  
  400.     PRP0 - size 6 - not written by Imagine
  401.  
  402.         UBYTE   Props[6];       ; more object properties
  403.  
  404.         This chunk contains object properties that programs other
  405.         than Turbo Silver might support.
  406.  
  407.         Props[0] - PRP_BLEND    ; blending factor (0-255)
  408.         Props[1] - PRP_SMOOTH   ; roughness factor
  409.         Props[2] - PRP_SHADE    ; shading on/off flag
  410.         Props[3] - PRP_PHONG    ; phong shading on/off flag
  411.         Props[4] - PRP_GLOSSY   ; glossy on/off flag
  412.         Props[5] - PRP_QUICK    ; Quickdraw on/off flag
  413.  
  414.         The blending factor controls the amount of dithering used
  415.         on the object - 255 is fully dithered.  
  416.         The roughness factor controls how rough the object should
  417.         appear - 0 is smooth, 255 is max roughness.
  418.         The shading flag is interpreted differently depending on
  419.         whether the object is a light source or not.  For light
  420.         sources, it sets the light to cast shadows or not.  For
  421.         normal objects, if the flag is set, the object is always
  422.         considered as fully lit - i.e. it's color is read directly
  423.         from the object (or IFF brush), and is not affected by light
  424.         sources.
  425.         The phong shading is on by default - a non-zero value turns
  426.         it off.
  427.         The glossy flag sets the object to be glossy or not.  If
  428.         the object is glossy, the "transmit" colors and the index
  429.         of refraction control the amount of "sheen".  The glossy
  430.         feature is meant to simulate something like a wax coating
  431.         on the object with the specified index of refraction. The
  432.         trasmission coefficients control how much light from the
  433.         object makes it through the wax coating.
  434.         The Quickdraw flag, if set, tells the editor not to draw
  435.         all the points and edges for the object, but to draw a
  436.         rectanglular solid centered at the object position, and
  437.         with sizes detemined by the axis lengths.
  438.  
  439.     PRP1 - size 8 - Imagine only
  440.  
  441.         UBYTE   IProps[8];       ; more object properties
  442.  
  443.         This chunk contains object properties that programs other
  444.         than Imagine might support.
  445.  
  446.         IProps[0] - IPRP_DITHER   ; blending factor (0-255)
  447.         IProps[1] - IPRP_HARD     ; hardness factor (0-255)
  448.         IProps[2] - IPRP_ROUGH    ; roughness factor (0-255)
  449.         IProps[3] - IPRP_SHINY    ; shinyness factor (0-255)
  450.         IProps[4] - IPRP_INDEX    ; index of refraction
  451.         IProps[5] - IPRP_QUICK    ; flag - Quickdraw on/off
  452.         IProps[6] - IPRP_PHONG    ; flag - Phong shading on/off
  453.         IProps[7] - IPRP_GENLOCK  ; flag - Genlock on/off
  454.  
  455.         The blending factor controls the amount of dithering used
  456.         on the object - 255 is fully dithered.  
  457.         The hardness factor controls how tight the specular spot
  458.         should be - 0 is a big soft spot, 255 is a tight hot spot
  459.         The roughness factor controls how rough the object should
  460.         appear - 0 is smooth, 255 is max roughness.
  461.         The shiny factor in interaction with the object's filter
  462.         values controls how shiny the object appears.  Setting it
  463.         to anything but zero forces the object to be non-transparent
  464.         since then the filter values are used in the shiny (reflection)
  465.         calculations.  A value of 255 means maximum shinyness.
  466.  
  467.     INTS - size 4 - not written by Imagine
  468.  
  469.         FRACT   Intensity;      ; light intensity
  470.  
  471.         This is the intensity field for light source objects.
  472.         an intensity of 255 for a sun-like light fully lights
  473.         object surfaces which are perpendicular to the direction
  474.         to the light source.  For lamp-like light sources, the
  475.         necessary intensity will depend on the distance to the light.
  476.  
  477.     INT1 - size 12 - Imagine only
  478.  
  479.         VECTOR  Intensity;      ; light intensity
  480.  
  481.         This is like INTS above, but has seperate R, G & B intensities.
  482.  
  483.     STRY - size 56 - not written by Imagine
  484.  
  485.         STORY   story;          ; a story structure for the object.
  486.  
  487.         The story structure is described above.
  488.  
  489.     ANID - size 64 - Imagine only
  490.  
  491.         LONG    Cellno;         ; cell number
  492.         TFORM   TForm;          ; object position/axes/size in that cell.
  493.  
  494.         For Imagine's "Cycle" objects, within EACH DESC chunk in the
  495.         file - that is, for each object of the group, there will be
  496.         a series of ANID chunks.  The cell number sequences of each
  497.         part of the must agree with the sequence for the head object,
  498.         and the first cell number must be zero.
  499.  
  500.     FORD - size 56 + 12 * PC - Imagine only
  501.  
  502.         WORD    NumC;           ; number of cross section points
  503.         WORD    NumF;           ; number of slices
  504.         WORD    Flags;          ; orientation flag
  505.         WORD    pad;            ; reserved
  506.         MATRIX  TForm;          ; object rotation/scaling transformation
  507.         VECTOR  Shift;          ; object translation
  508.         VECTOR  Points[PC];     ; "Forms" editor points
  509.  
  510.         For Imagine's "Forms" objects, the "PNTS" chunk above is not
  511.         written out, but this structure is written instead.  The point
  512.         count is PC = NumC + 4 * NumF.  The object's real points are
  513.         then calculated from these using a proprietary algorithm.
  514.         The tranformation parameters above allow the axes of the
  515.         real object be moved around relative to the "Forms" points.
  516.  
  517.  
  518.     DESC notes
  519.     ----------
  520.  
  521.     Again, most of these fields are optional, and defaults are supplied.
  522.     However, if there is a FACE chunk, there must also be a CLST chunk,
  523.     an RLST chunk and a TLST chunk -- all with matching "count" fields.
  524.     The SHAP chunk is not optional. 
  525.  
  526.     Defaults are:  Colors set to (240,240,240); reflection and
  527.     transmission coefficients set to zero; illegal shape; no story or
  528.     special surface types; position at (0,0,0); axes aligned to the
  529.     world axes; size fields all 32.0; intensity at 300; no name;
  530.     no points/edges or faces; texture parameters set to zero; refraction
  531.     type 0 with index 1.00; specular, hardness and roughness set to zero;
  532.     blending at 255; glossy off; phong shading on; not a light source;
  533.     not brightly lit;
  534.  
  535.     In Imagine, defaults are the same, but with colors (255,255,255).
  536.  
  537.  
  538.     INFO sub-chunks
  539.     ---------------
  540.  
  541.     BRSH - size 82
  542.  
  543.         WORD    Number;        ; Brush number (between 0 and 7)
  544.         CHAR    Filename[80];  ; IFF ILBM filename
  545.  
  546.         There may be more than one of these.
  547.  
  548.     STNC - size 82
  549.  
  550.         Same format as BRSH chunk.
  551.  
  552.     TXTR - size 82
  553.  
  554.         Same format as BRSH chunk.  The Filename field is the name of
  555.         a code module that can be loaded with LoadSeg().
  556.  
  557.     OBSV - size 28
  558.  
  559.         VECTOR  Camera;         ; Camera position
  560.         VECTOR  Rotate;         ; Camera rotation angles
  561.         FRACT   Focal;          ; Camera focal length
  562.  
  563.         This tells where the camera is, how it is aimed, and its
  564.         focal length.  The rotation angles are in degrees, and specify
  565.         rotations around the X, Y, and Z axes.  The camera looks down
  566.         its own Y axis, with the top of the picture in the direction of
  567.         the Z axis.  If the rotation angles are all zero, its axes
  568.         are aligned with the world coordinate axes.  The rotations are
  569.         performed in the order ZXY about the camera axes.  A positive
  570.         angle rotates Y toward Z, Z toward X, and X toward Y for
  571.         rotations about the X, Y, and Z axes respectively.  To
  572.         understand the focal length, imagine a 320 x 200 pixel
  573.         rectangle perpendicular to, and centered on the camera's
  574.         Y axis.  Any objects in the infinite rectangular cone defined
  575.         by the camera position and the 4 corners of the rectangle will
  576.         appear in the picture.
  577.  
  578.     OTRK - size 18
  579.  
  580.         BYTE    Trackname[18];
  581.  
  582.         This chunk specifies the name of an object that the camera
  583.         is "tracked" to.  If the name is NULL, the camera doesn't
  584.         track.  Otherwise, if the object is moved inside Turbo Silver,
  585.         the camera will follow it.
  586.  
  587.     OSTR - size 56
  588.  
  589.         STORY   CStory;         ; a STORY structure for the camera
  590.  
  591.         The story structure is defined above.
  592.  
  593.     FADE - size 12
  594.  
  595.         FRACT   FadeAt;         ; distance to start fade
  596.         FRACT   FadeBy;         ; distance of total fade
  597.         BYTE    pad;            ; pad byte - must be zero
  598.         COLOR   FadeTo;         ; RGB color to fade to
  599.  
  600.     SKYC - size 8
  601.  
  602.         BYTE    pad;            ; pad byte - must be zero
  603.         COLOR   Horizon;        ; horizon color
  604.         BYTE    pad;            ; pad byte - must be zero
  605.         COLOR   Zenith;         ; zenith color
  606.  
  607.     AMBI - size 4
  608.  
  609.         BYTE    pad;            ; pad byte - must be zero
  610.         COLOR   Ambient;        ; abmient light color
  611.  
  612.     GLB0 - size 8
  613.  
  614.         BYTE    Props[8];       ; an array of 8 "global properties" used
  615.                                 ; by Turbo Silver.
  616.  
  617.         Props[0] - GLB_EDGING       ; edge level (globals requester)
  618.         Props[1] - GLB_PERTURB      ; perturbance (globals requester)
  619.         Props[2] - GLB_SKY_BLEND    ; sky blending factor (0-255)
  620.         Props[3] - GLB_LENS         ; lens type (see below)
  621.         Props[4] - GLB_FADE         ; flag - Sharp/Fuzzy focus (globals)
  622.         Props[5] - GLB_SIZE         ; "apparant size" (see below)
  623.         Props[6] - GLB_RESOLVE      ; resolve depth (globals requester)
  624.         Props[7] - GLB_EXTRA        ; flag - genlock sky on/off
  625.  
  626.         The edging and perturbance values control the heuristics in
  627.         ray tracing.  The sky blending factor is zero for no blending,
  628.         and 255 for full blending.  The lens type is a number from 0
  629.         4, corresponding to the boxes in the "camera" requester, and
  630.         correspond to 0) Manual, 1) Wide angle, 2) Normal, 3) Telephoto,
  631.         and 4) Custom.  It is used in setting the camera's focal length
  632.         if the camera is tracked to an object.  The Sharp/Fuzzy flag
  633.         turns the "fade" feature on and off - non-zero means on.
  634.         The "apparant size" parameter is 100 times the "custom size"
  635.         parameter in the camera requester.  And is used to set the
  636.         focal length for a custom lens.  The "resolve depth" controls
  637.         the number of rays the ray tracer will shoot for a single pixel.
  638.         Each reflective/refractive ray increments the depth counter, and
  639.         the count is never allowed to reach the "resolve depth".  If both
  640.         a reflective and a refractive ray are traced, each ray gets its
  641.         own version of the count - so theoretically, a resolve depth of
  642.         4 could allow much more than 4 rays to be traced.  The "genlock
  643.         sky" flag controls whether the sky will be colored, or set to
  644.         the genlock color (color 0 - black) in the final picture.
  645.  
  646.  
  647.     All of the INFO sub-chunks are optional, as is the INFO chunk.
  648.     Default values are supplied if the chunks are not present.  The
  649.     defaults are:  no brushes, stencils, or textures defined; no story
  650.     for the camera; horizon and zenith and ambient light colors set
  651.     to black; fade color set to (80,80,80);  un-rotated, un-tracked
  652.     camera at (-100, -100, 100); and global properties array set to
  653.     [30, 0, 0, 0, 0, 100, 8, 0].
  654.  
  655.  
  656.     EXTR sub-sub-chunks
  657.     -------------------
  658.  
  659.     MTRX - size 60
  660.  
  661.         VECTOR  Translate;      ; translation vector
  662.         VECTOR  Scale;          ; X,Y and Z scaling factors
  663.         MATRIX  Rotate;         ; rotation matrix
  664.  
  665.         The translation vector is i world coordinates.
  666.         The scaling factors are with respect to local axes.
  667.         The rotation matrix is with respect to the world axes,
  668.         and it should be a "unit matrix".
  669.         The rotation is such that a rotated axis's X,Y, and Z
  670.         components are the dot products of the MATRIX's I,J,
  671.         and K vectors with the un-rotated axis vector.
  672.  
  673.     LOAD - size 80
  674.  
  675.         BYTE    Filename[80];   ; the name of the external file
  676.  
  677.         This chunk contains the name of an external object file.
  678.         The external file should be a FORM TDDD file.  It may contain
  679.         an any number of objects possibly grouped into heirarchy(ies).
  680.  
  681.     Both of these chunks are required.
  682.  
  683.